<template>
  <div class="home">
    <StoreDetail :detail="detail" />
  </div>
</template>

<script>
import pageLoadingMixin from '~/plugins/pageLoadingMixin';
export default {
  name: 'ShopDetail',
  mixins: [pageLoadingMixin],
  data() {
    return {
      detail: {}
    };
  },
  async fetch() {
    await Promise.allSettled([this.getStoreInfo()]);
  },
  head() {
    return {
      title: this.$t('shopdetail.title'),
      meta: [
        { hid: 'description', name: 'description', content: this.$t('shopdetail.description') }
      ]
    };
  },
  methods: {
    async getStoreInfo() {
      const res = await this.$api.post('/stores/getStoreInfo', {
        store_id: +this.$route.params.id // 店铺ID
      });
      this.detail = res;
    }
  }
};
</script>
